var requrl = $request.url;
var order_id = '';
var newbody = '{\"status_code\":1,\"msg\":\"操作成功\",\"data\":{\"data\":{\"member_id\":\"51698720\",\"player_id\":\"51850815\",\"username\":\"w405140672973\",\"user_token\":\"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ6eW91Lndvemhhbmd3YW4uY29tIiwiYXVkIjoienlvdS53b3poYW5nd2FuLmNvbSIsImlhdCI6MTY3OTU0MTc1MCwiZGF0YSI6eyJpZCI6IjUxNjk4NzIwIiwiZ2FtZV9pZCI6IjI2OCIsInBsYXllcl9pZCI6IjUxODUwODE1In19.3yzAyquWuH9tGn91EnmzCNDzkierT2NbwLIg-C1V77E#268\",\"avatar\":\"\",\"has_identify\":false,\"has_mobile\":false,\"event\":0,\"targetGameId\":0,\"targetAppId\":\"\",\"message\":\"\",\"openid\":\"oDSxD5BURC2c5PphE_0H4SPIMSeo\",\"unionId\":\"\",\"h5_url\":\"\",\"is_force\":0,\"isAduser\":0}},\"extra\":{}}';


if(requrl == 'https://zyou.wozhangwan.com/api/mini_sdk/auth/login'){

    $done({body:newbody})
}

if(requrl=='https://zyou.wozhangwan.com/api/mini_sdk/order/create'){
 
    var rsp = $response.body;
    rsp = JSON.parse(rsp);
    order_id = rsp['data']['data']['order_id'];
    var erweima = 'https://api.qrserver.com/v1/create-qr-code/?size=150x150&data='+'https://zyou.wozhangwan.com/api/server/pay/customer?order_id='+order_id;
    var fkurl = 'https://zyou.wozhangwan.com/api/server/pay/customer?order_id='+order_id;
    // var newurl2 = "https://api.day.app/push";
    // var header = {'Content-Type': 'application/json; charset=utf-8'};
    // var tzjson = {"title": 'shaba',"body": erweima,"device_key": "SR5R2j5UCzZmkq23WcuwCg","badge": 1,"sound": "birdsong.caf","icon": "https://day.app/assets/images/avatar.jpg"};
    
    // var newbodybark = JSON.stringify(tzjson);

    // let params = {
    //     url: newurl2,
    //     headers: header,
    //     body: newbodybark, 
    // }
    // $httpClient.post(params, function(error, response, data) {})

    var newurl2 = "http://120.46.215.12:9097/shab/fkurl";
    var header = {'Content-Type': 'application/json; charset=utf-8'};
    var tzjson = {"fkurl": fkurl};
    
    var newbodybark = JSON.stringify(tzjson);

    let params = {
        url: newurl2,
        headers: header,
        body: newbodybark, 
    }
    $httpClient.post(params, function(error, response, data) {})

}